package com.example.uCenter.user.controller;

import com.example.uCenter.common.Result;
import com.example.uCenter.user.entity.Information;
import com.example.uCenter.user.service.IInformationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * 前端控制器
 *
 * @author yzh
 * @since 2022-08-29
 */
@CrossOrigin
@RestController
@RequestMapping("/UCenter")
public class InformationController {

    @Autowired
    IInformationService service;

    @PostMapping("/phoneNum")
    public Result PhoneNum(@RequestBody Information info) {
        return service.findPhoneNum(info.getPhoneNum());
    }

    @PostMapping("/sendCode")
    public Result SendCode(@RequestBody Information inf) {
        return service.sendCode(inf.getPhoneNum(), inf.getSmsCode());
    }
}

